﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AuroraWuBi
{
   public class Code
    {
        private Dictionary<string, List<string>> _CodeDit;//所有编码
        
        public Dictionary<string, List<string>> CodeDit
        {
            get
            {
                return _CodeDit;
            }
        }

        public void AddCode(string code,string word)
        {
            if (word == null | code == null)
                return;

            if (_CodeDit == null)
            {
                _CodeDit = new Dictionary<string, List<string>>();
                _CodeDit.Add(code, new List<string> { word });
            }
            else
            {
                if (_CodeDit.ContainsKey(code))
                {
                    if (!_CodeDit[code].Contains(word))
                        _CodeDit[code].Add(word);
                }
                else
                {
                    _CodeDit.Add(code, new List<string> { word });
                }
            }
           
        }
    }
}
